﻿<UserControl x:Class="GraphLight.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
        xmlns:Drawing="clr-namespace:GraphLight.Drawing;assembly=GraphLight.Drawing"
        Loaded="userControlLoaded">
    <Grid x:Name="LayoutRoot">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <controls:TabControl x:Name="tabCtrl" SelectedIndex="{Binding TabIndex, Mode=TwoWay}">
            <controls:TabControl.Items>
                <controls:TabItem Header="Graph">
                    <Drawing:GraphControl x:Name="ctrlGraph" Graph="{Binding Graph, Mode=TwoWay}" />
                </controls:TabItem>
                <controls:TabItem x:Name="tiText" Header="Text">
                    <ScrollViewer>
                        <TextBox x:Name="tbText" Text="{Binding GraphDefinition}" />
                    </ScrollViewer>
                </controls:TabItem>
            </controls:TabControl.Items>
        </controls:TabControl>
        <StackPanel Grid.Row="1" Orientation="Horizontal">
            <Button x:Name="btnOpen" Content="Open File" Click="btnOpenClick" Margin="5" />
            <Button x:Name="btnLayout" Content="Layout" Command="{Binding ElementName=ctrlGraph, Path=LayoutCommand}" Margin="5" />
            <ComboBox x:Name="cbExamples" ItemsSource="{Binding ExampleCollection}"
                    SelectedItem="{Binding SelectedExample, Mode=TwoWay}" />
        </StackPanel>
    </Grid>
</UserControl>
